package com.tdkj.model.bbs;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * EjfSection entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ejf_section", catalog = "west")
public class EjfSection implements java.io.Serializable {

	// Fields

	private Integer sectionId;
	private String sectionName;
	private Integer seqno;
	private Integer cols;
	private String moderator;
	private String state;
	private Timestamp createTime;
	private Timestamp updateTime;
	private Set<EjfBoard> ejfBoards = new HashSet<EjfBoard>(0);

	// Constructors

	/** default constructor */
	public EjfSection() {
	}

	/** minimal constructor */
	public EjfSection(String sectionName, Timestamp updateTime) {
		this.sectionName = sectionName;
		this.updateTime = updateTime;
	}

	/** full constructor */
	public EjfSection(String sectionName, Integer seqno, Integer cols, String moderator, String state, Timestamp createTime, Timestamp updateTime, Set<EjfBoard> ejfBoards) {
		this.sectionName = sectionName;
		this.seqno = seqno;
		this.cols = cols;
		this.moderator = moderator;
		this.state = state;
		this.createTime = createTime;
		this.updateTime = updateTime;
		this.ejfBoards = ejfBoards;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "sectionID", unique = true, nullable = false)
	public Integer getSectionId() {
		return this.sectionId;
	}

	public void setSectionId(Integer sectionId) {
		this.sectionId = sectionId;
	}

	@Column(name = "sectionName", nullable = false, length = 20)
	public String getSectionName() {
		return this.sectionName;
	}

	public void setSectionName(String sectionName) {
		this.sectionName = sectionName;
	}

	@Column(name = "seqno")
	public Integer getSeqno() {
		return this.seqno;
	}

	public void setSeqno(Integer seqno) {
		this.seqno = seqno;
	}

	@Column(name = "cols")
	public Integer getCols() {
		return this.cols;
	}

	public void setCols(Integer cols) {
		this.cols = cols;
	}

	@Column(name = "moderator", length = 60)
	public String getModerator() {
		return this.moderator;
	}

	public void setModerator(String moderator) {
		this.moderator = moderator;
	}

	@Column(name = "state", length = 1)
	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	@Column(name = "createTime", length = 19)
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	@Column(name = "updateTime", nullable = false, length = 19)
	public Timestamp getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Timestamp updateTime) {
		this.updateTime = updateTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "ejfSection")
	public Set<EjfBoard> getEjfBoards() {
		return this.ejfBoards;
	}

	public void setEjfBoards(Set<EjfBoard> ejfBoards) {
		this.ejfBoards = ejfBoards;
	}

}